﻿namespace Ecobee.Net
{
	public class Page : ApiObject
	{
		/// <summary>
		/// The page retrieved or, in the case of a request parameter, the specific page requested.
		/// </summary>
		public int CurrentPage { get; set; }

		/// <summary>
		/// The total pages available. 
		/// </summary>
		public int TotalPages { get; set; }

		/// <summary>
		/// The number of objects on this page.
		/// </summary>
		public int PageSize { get; set; }

		/// <summary>
		/// The total number of objects available.
		/// </summary>
		public int Total { get; set; }

		protected override void OnFromDataObject(dynamic dataObject)
		{
			this.CurrentPage = dataObject.page;
			this.TotalPages = dataObject.totalPages;
			this.PageSize = dataObject.pageSize;
			this.Total = dataObject.total;
		}
	}
}
